package woa.sort.test20241118;

import java.util.Arrays;

/**
 * @author wangpeng
 * @version 1.0
 * @date 2024/11/18 20:37
 */
public class MergeSort {

    public static void main(String[] args) {
        int[] arr = new int[]{4,3,5,6,71,2,1,9,8,7,10,11,12,13,14,15,16,17,18,19,20};
        sort(arr, 0, arr.length - 1);
        System.out.println(Arrays.toString(arr));
    }

    private static void sort(int[] arr, int left, int right) {
        if (left < right) {
            int mid = left + (right - left) / 2;
            sort(arr, left, mid);
            sort(arr, mid + 1, right);
            merge(arr, left, mid, right);
        }
    }

    private static void merge(int[] arr, int left, int mid, int right) {
        int[] temp = new int[right - left + 1];
    }
}
